package com.javayh.config.file;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.MultipartConfigElement;

/**
 * @author Dylan Yang
 * @Title: UploadFileConfiguration
 * @ProjectName lucky
 * @Description: TODO
 * @date 2018/10/422:36
 */
@Configuration
public class UploadFileConfiguration {

    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setMaxFileSize("256KB");
        factory.setMaxRequestSize("512KB");
        return factory.createMultipartConfig();
    }

}

